package com.fm.mediasoup.sdp;

public class Origin {
    public String address;
    public Integer ipVer;
    public String netType;
    public String sessionId;
    public Integer sessionVersion;
    public String username;

    public Origin(Builder builder) {
        address = builder.address;
        ipVer = builder.ipVer;
        netType = builder.netType;
        sessionId = builder.sessionId;
        sessionVersion = builder.sessionVersion;
        username = builder.username;
    }

    public Origin(){

    }

    @Override
    public String toString() {
        return "Origin{" +
                "address='" + address + '\'' +
                ", ipVer=" + ipVer +
                ", netType='" + netType + '\'' +
                ", sessionId='" + sessionId + '\'' +
                ", sessionVersion=" + sessionVersion +
                ", username='" + username + '\'' +
                '}';
    }

    public static class Builder{
        public Builder setAddress(String address) {
            this.address = address;
            return this;
        }

        public Builder setIpVer(Integer ipVer) {
            this.ipVer = ipVer;
            return this;
        }

        public Builder setNetType(String netType) {
            this.netType = netType;
            return this;
        }

        public Builder setSessionId(String sessionId) {
            this.sessionId = sessionId;
            return this;
        }

        public Builder setSessionVersion(Integer sessionVersion) {
            this.sessionVersion = sessionVersion;
            return this;
        }

        public Builder setUsername(String username) {
            this.username = username;
            return this;
        }

        public Origin build(){
            return new Origin(this);
        }

        private String address;
        private Integer ipVer;
        private String netType;
        private String sessionId;
        private Integer sessionVersion;
        private String username;

    }
}
